package com.ruoyi.web.controller.storage;

import java.util.List;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.storage.bicycle.domain.Bicycle;
import com.ruoyi.storage.dataBackhaul.domain.DataBackhaulOrder;
import com.ruoyi.storage.dataBackhaul.service.DataBackhaulService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.storage.orderWarehousing.domain.BicycleOrder;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 数据回传Controller
 *
 * @author zzx
 * @date 2024-03-17
 */
@RestController
@RequestMapping("/dataBackhaul/dataBackhaul")
public class DataBackhaulController extends BaseController
{
    @Autowired
    private DataBackhaulService dataBackhaulService;

    /**
     * 查询数据回传列表
     */
    @PreAuthorize("@ss.hasPermi('orderwarehousing:orderwarehousing:list')")
    @GetMapping("/list")
    public TableDataInfo list(Bicycle bicycle)
    {
        startPage();
        List<Bicycle> list = dataBackhaulService.selectBicycleOrderList(bicycle);
        return getDataTable(list);
    }
    @GetMapping("/syncBackhaul/{bicycleIds}")
    public AjaxResult syncBackhaul(@PathVariable String[] bicycleIds)
    {
        return dataBackhaulService.syncBackhaulBybicycleIds(bicycleIds);
    }

}
